package IOTest;

import java.io.IOException;
import java.io.PrintWriter;

public class PrintWriterOutput {
    public static void main(String[] args) {
        try(PrintWriter printWriter = new PrintWriter("D:/example/test.txt")) {
            printWriter.print("你好\n");
            printWriter.printf("%d + %d = %d\n", 10, 20, 30);
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
